package com.xnyzc.lhy.order.controller.task;

import com.xnyzc.lhy.order.mq.MqOrderConsumer;
import com.xnyzc.lhy.order.service.task.IBatchUpdateOrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description 批量更新接单数据
 * @Author zhuyubin
 * @Date 2019-09-02 17:59
 **/
@RestController
@RequestMapping(value = "/task/batchUpdateOrders")
public class BatchUpdateOrdersController {

    @Autowired
    private MqOrderConsumer orderConsumer;

    @Autowired
    private IBatchUpdateOrdersService iBatchUpdateOrdersService;

    @GetMapping(value = "/updateOrdersData")
    public void updateOrdersData() {
        iBatchUpdateOrdersService.updateOrdersData();
    }

    @GetMapping(value = "/driverActiveListen")
    public void driverActiveListen() {
        iBatchUpdateOrdersService.driverActiveListen();
    }

    /**
     * 更改等待应答为超时
     */
    @GetMapping(value = "/updateOrderStatus")
    public void updateOrderStatus() {
        iBatchUpdateOrdersService.updateOrderStatus();
    }

    /**
     * 开始订单调度
     */
    @GetMapping(value = "/dispatchOrder")
    public void dispatchOrder() {
        orderConsumer.dispatchOrder();
    }

}
